<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-09-09 10:07:06
 * @LastEditTime: 2019-10-17 14:13:05
 * @LastEditors: Please set LastEditors
 -->
<template>
  <div class="qirencheng animated bounceInRight">
    <div class="header">
      <div @click="histry">
        <img src="../../assets/histry.png">
        返回
      </div>
      <span class="reg" style="margin-left:-0.4rem;">企业认证</span>
      <span class="log"></span>
    </div>
    <img class="img" src="../../assets/qiye.png" alt="">
    <p class="text1">恭喜您企业认证成功</p>
    <p class="text2">不完美不要紧，贵在持续“精进”</p>
    <div class="haode" @click="sure">好的</div>
  </div>
</template>

<script>
import { check_login } from "../../api/api.js";
export default {
  name: "qirencheng",
  data() {
    return {
      baocun:true,
      phone:'',
      sj: "",
      show: true,
      timer: null,
    };
  },
  mounted() {
    if (sessionStorage.getItem("mobile") != null) {
      this.phone = JSON.parse(sessionStorage.getItem("mobile"));
    }
    check_login({
      data: {
        mobile: this.phone
      }
    }).then(res => {
      if (res.data.code == 11001) {
      } else if (res.data.code == 11000) {
        this.$toast("未登录，请重新登录");
        this.$router.push("/");
      }
    });
    this.dao()
  },
  created(){
  },
  watch: {},
  methods: {
      //   倒计时
    dao() {
      this.show = false;
      const TIME_COUNT = 3;
      if (!this.timer) {
        this.sj = TIME_COUNT;
        this.show = false;
        this.timer = setInterval(() => {
          if (this.sj > 0 && this.sj <= TIME_COUNT) {
            this.sj--;
          } else {
            this.show = true;
            clearInterval(this.timer);
            this.timer = null;
            this.$router.push('/myren')
          }
        }, 1000);
      }
    },
    // 返回上一层
    histry() {
      this.$router.go(-1);
    },
    sure(){
        this.$router.push('/myren')
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.qirencheng {
  height: 100vh;
  background: #fff;
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 0.5rem;
    line-height: 0.5rem;
    padding: 0 0.15rem;
    border-bottom: 0.01rem solid #eee;
    div {
      display: flex;
      justify-content: left;
      align-items: center;
      color: #979797;
      font-size: 0.14rem;
      img {
        height: 0.16rem;
        width: 0.08rem;
        margin-right: 0.08rem;
      }
    }
    .reg {
      font-size: 0.18rem;
      color: #1a2533;
      font-weight: 500;
    }
    .log {
      font-size: 0.14rem;
      color: #e82716;
      font-weight: bold;
    }
  }
  .img{
      height:0.74rem;
      width:0.82rem;
      display: block;
      margin: 0 auto;
      margin-top:0.85rem;
      margin-bottom: 0.37rem;
  }
  .text1{
      font-size: 0.18rem;
      color:#1A2533;
      text-align: center;
  }
  .text2{
      font-size: 0.14rem;
      color:#A9A9A9;
      text-align: center;
      margin-top:0.12rem;
      letter-spacing:0.04rem;
  }
  .haode{
      height:0.3rem;
      width:1.2rem;
      line-height: 0.3rem;
      text-align: center;
      margin: 0 auto;
      margin-top:0.96rem;
      border:0.01rem solid #A9A9A9;
      font-size: 0.14rem;
      color:#888888;
      border-radius: 0.03rem;
  }
}
</style>
